Skip to content

Update Mistral AI chat models - #6721

Open
nicolaskrier wants to merge 1 commit into
spring-projects:mainfrom
nicolaskrier:update-mistral-ai-models
Open

Update Mistral AI chat models#6721
nicolaskrier wants to merge 1 commit into
spring-projects:mainfrom
nicolaskrier:update-mistral-ai-models

Conversation

@nicolaskrier

Copy link
Copy Markdown
Contributor

Description

  • Remove devstral-latest retired the 31st of July 2026,
  • Remove magistral-medium-latest retired the 31st of July 2026,
  • Remove magistral-small-latest retired the 31st of July 2026,
  • Remove open-mistral-nemo retired the 31st of July 2026,
  • Update Mistral AI Chat documentation,
  • Polish integration tests.

Explanations

See Mistral AI Models documentation, especially Legacy Models section.

Comment on lines -295 to -301
@Deprecated(forRemoval = true) // Retirement planned the 31st of July 2026
DEVSTRAL("devstral-latest"),
@Deprecated(forRemoval = true) // Retirement planned the 31st of July 2026
MAGISTRAL_SMALL("magistral-small-latest"),
// Free Models - Research
@Deprecated(forRemoval = true) // Retirement planned the 31st of July 2026
OPEN_MISTRAL_NEMO("open-mistral-nemo");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing these enums is breaking binary compatibility. Please, include a sub-section in upgrade-notes.adoc under the section [[upgrading-to-2-0-1]], describing the breakage of backward compatibility and what a user needs to do in order to successfully upgrade to 2.0.1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this comment. I forgot to add an upgrade note in a previous similar PR, although it is very useful for users. Please let me know what you think about the upgrade note I have just added.

I noticed that you assigned the 2.1.x milestone to this PR instead of 2.0.1. Could you tell me which version we are targeting? I will adapt the upgrade note version accordingly if necessary.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry about the confusion. It is not a practice in Spring to break binary compatibility in a patch release (like 2.0.1), thus we have to target 2.1.0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanations. I have just created a new Upgrading to 2.1.0 section, please let me know what do you think about it.

@dimitarproynov dimitarproynov added this to the 2.1.x milestone Aug 3, 2026
@nicolaskrier
nicolaskrier force-pushed the update-mistral-ai-models branch 3 times, most recently from 3b264ee to 7810379 Compare August 3, 2026 18:42
Using these models will now cause:

- **Compilation failure**: If referenced directly from `MistralAiApi.ChatModel`.
- **Unexpected behavior**: If used via the `spring.ai.mistralai.chat.model` property, as Mistral AI redirects requests to these deprecated models to alternative models (e.g., `mistral-medium-3.5` instead of `magistral-medium-latest`).

@nicolaskrier nicolaskrier Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified this redirection while debugging org.springframework.ai.mistralai.MistralAiChatModelIT.thinkingCall with ChatModel.MAGISTRAL_MEDIUM on main branch and checking org.springframework.ai.mistralai.api.MistralAiApi.ChatCompletion.model corresponding value in the response.

Comment thread spring-ai-docs/src/main/antora/modules/ROOT/pages/upgrade-notes.adoc Outdated
@nicolaskrier
nicolaskrier force-pushed the update-mistral-ai-models branch from 7810379 to 7c130b7 Compare August 4, 2026 11:06
- Remove devstral-latest retired the 31st of July 2026
- Remove magistral-medium-latest retired the 31st of July 2026
- Remove magistral-small-latest retired the 31st of July 2026
- Remove open-mistral-nemo retired the 31st of July 2026
- Update Mistral AI Chat documentation
- Add an upgrade note for 2.0.1 version regarding these deprecations
- Polish integration tests

Signed-off-by: Nicolas Krier <7557886+nicolaskrier@users.noreply.github.com>
@nicolaskrier
nicolaskrier force-pushed the update-mistral-ai-models branch from 7c130b7 to 82a452f Compare August 4, 2026 16:22
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@EnumSource(value = ChatModel.class, names = { "MAGISTRAL_MEDIUM", "MISTRAL_MEDIUM", "MISTRAL_SMALL" })
@EnumSource(value = ChatModel.class, names = { "MISTRAL_MEDIUM", "MISTRAL_SMALL" })

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dimitarproynov: The integration tests are currently failing for Mistral Medium on the main branch. Do you plan to create a maintenance branch for 2.0.x soon and to continue 2.1.x on main?

  • If so, we should consider merging this PR to main and applying changes from this PR regarding integration tests on 2.0.x branch.
  • If not, we should consider splitting this PR into parts:
    • one with just the integration test fixes, to merge to main ASAP,
    • one for removing Mistral AI chat model enumeration elements, to merge to main later on.

What do you think about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants